package com.demo.pattern.decorate;

/**
 * @author sourire
 * @version 1.0
 * @date 2020/8/27 10:28
 */
public class Milk extends CondimentDecorator {
    //牛奶
    Beverage beverage;
    Milk(Beverage beverage){
        this.beverage = beverage;
        describe = "牛奶";
        price = 2.0f;
    }

    @Override
    public String getDescribe() {
        return beverage.getDescribe()+",加入了"+this.describe;
    }

    @Override
    public float cost() {
        return this.getPrice()+beverage.cost();
    }
}
